package com.suanfa.sort;

import com.suanfa.util.ArrayUtils;

public class BubboSort {

    public static void main(String[] args) {
        int[] arr={ 49, 38, 65, 97, 23, 22, 76, 1, 5, 8, 2, 0, -1, 22};
        bubboSort(arr);
        ArrayUtils.printArray(arr);
    }
    public static void bubboSort(int[] arr){
        for(int i =0; i<arr.length; i++){
            for(int j= i+1; j< arr.length; j++){
                if (arr[i] > arr[j]){
                    int temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;
                }
            }
        }

    }
}
